
 import home from './pages/home.vue'

// import about from './pages/about.vue'
// import article from './pages/article.vue'
// import archive from './pages/archive.vue'
// import apply from './pages/apply.vue'
// import login from "./pages/login.vue"
// import main from "./pages/main.vue"
// import read from  "./components/read.vue"
 // import tag from  "./pages/tag.vue" 
// import manage from "./components/manage.vue"
// import log from  "./components/log.vue"
// import list from "./components/list.vue"
// import friendlist from "./components/friendlist.vue"
// import editor from "./components/editor.vue"

// const read = () => import('./components/read.vue')

// const editor = () => import('./components/editor.vue')

// const log = () => import('./components/log.vue')

// const list = () => import('./components/list.vue')

// const friendlist = () => import('./components/friendlist.vue')


// const manage = () => import('./components/manage.vue')
 


import { resolve } from 'path';

 var routes = [{
	path:'/',
    component:home
},
{
	path:'/home',
	name:'home',
    component:home
}, 
{
    path:'/about',
    name:'about',
    component:resolve => require(['./pages/about.vue'],resolve)
},
{
    path:'/archive',
    name:'archive',
    component:resolve => require(['./pages/archive.vue'],resolve)
},
{
    path:'/tag',
    name:'tag',
    component:resolve => require(['./pages/tag.vue'],resolve)
},
{
    path:'/article/:id',
    name:'article',
    component:resolve => require(['./pages/article.vue'],resolve)
},
{
    path:'/apply',
    name:'apply',
    component:resolve => require(['./pages/apply.vue'],resolve)
},
{
    path:'*',
    redirect:'/'
},{
    path:"/login",
    name:"login",
    component:resolve => require(['./pages/login.vue'],resolve)
},{
    path:"/main",
    name:"main",
    component:resolve => require(['./pages/main.vue'],resolve),
    children:[   
  {
       path:"/main/read"  ,
       component:r => require.ensure([], () => r(require('./components/read.vue')), 'demo')

        },
        {   name:"manage",
            path:"/main/manage"  ,
            component:r => require.ensure([], () => r(require('./components/manage.vue')), 'demo')
     
             },
             {
                path:"/main/log"  ,
                component:r => require.ensure([], () => r(require('./components/log.vue')), 'demo')
         
                 },
                 {
                    path:"/main/friend"  ,
                    component:r => require.ensure([], () => r(require('./components/friendlist.vue')), 'demo')
             
                     },
                     {
                        path:"/main/list"  ,
                        component:r => require.ensure([], () => r(require('./components/list.vue')), 'demo')
                 
                         },
                         {
                            
                                name:'editor',
                                    path:"/main/editor"  ,
                                    component:r => require.ensure([], () => r(require('./components/editor.vue')), 'demo')
                         } 
                        
    ],
    meta:{
        requireAuth:true
       
    }
	
}


]

export default routes;